package com.kh.rationaldrugreview.mapper;

import com.kh.rationaldrugreview.entity.Prescription;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface PrescriptionMapper {
    
    List<Prescription> findAll();
    
    Prescription findById(@Param("prescriptionId") Long prescriptionId);
    
    Prescription findByNumber(@Param("prescriptionNumber") String prescriptionNumber);
    
    List<Prescription> findByPatientId(@Param("patientId") Long patientId);
    
    List<Prescription> findByDoctorName(@Param("doctorName") String doctorName);
    
    List<Prescription> findByDepartment(@Param("department") String department);
    
    List<Prescription> findByDateRange(@Param("startDate") LocalDateTime startDate, 
                                       @Param("endDate") LocalDateTime endDate);
    
    List<Prescription> findByReviewStatus(@Param("reviewStatus") String reviewStatus);
    
    List<Prescription> findUnreviewed();
    
    int insert(Prescription prescription);
    
    int update(Prescription prescription);
    
    int deleteById(@Param("prescriptionId") Long prescriptionId);
    
    int count();
}